ActionController::Routing::Routes.draw do |map|
  # The priority is based upon order of creation: first created -> highest priority.

  # Sample of regular route:
  #   map.connect 'products/:id', :controller => 'catalog', :action => 'view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   map.resources :products

  # Sample resource route with options:
  #   map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }

  # Sample resource route with sub-resources:
  #   map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller

  # Sample resource route within a namespace:
  #   map.namespace :admin do |admin|
  #     # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
  #     admin.resources :products
  #   end

  # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
  # map.root :controller => "welcome"

  # See how all your routes lay out with "rake routes"
  
  map.thumbnails 'thumbnails/',
    :controller => 'thumbnails'
	    
  #Standaard route
  map.default_route '', :controller => "dashboard"
  
  #Resources van eigen models
  map.resources :declarations
  map.resources :deposits
  map.resources :notices
  
  #Act_as_authenticated
  map.resources :users, :collection => { :display_login_fields => :post }
  map.resource  :session
  map.signup '/signup', :controller => 'users', :action => 'new'
  map.login  '/login', :controller => 'sessions', :action => 'new'
  map.logout '/logout', :controller => 'sessions', :action => 'destroy'
  
  #Shortcuts
  map.my_profile '/my_profile', :controller => 'users', :action => 'edit_current_user'
  map.my_declarations '/my_declarations', :controller => 'declarations', :action => 'my'
  map.my_deposits '/my_deposits', :controller => 'deposits', :action => 'my'
  map.confirm_deposit '/deposits/confirm', :controller => "deposits", :action => "confirm" #Moet vervangen worden
  
  #Dit kan ook beter:
  map.module_balans 'ajax/module_balans', :controller => 'ajax', :action => 'module_balans'
  map.module_balans 'ajax/add_user_to_declaration', :controller => 'ajax', :action => 'add_user_to_declaration'
  map.module_balans 'ajax/edit_additional_users_of_declaration', :controller => 'ajax', :action => 'edit_additional_users_of_declaration'
  map.module_balans 'ajax/:action=>remove_user_from_declaration', :controller => 'ajax', :action => ':action=>remove_user_from_declaration'

  # Install the default routes as the lowest priority.
  #map.connect ':controller/:action/:id'
  #map.connect ':controller/:action/:id.:format'
end
